library ieee;
use ieee.electrical_systems.all;
use ieee.mechanical_systems.all;
 
entity dc_motor is
     generic (kt : real;
              j  : real;
              r  : real;
              ke : real;             
              d  : real;
              l  : real);
     port (terminal p, m  : electrical;
           terminal rotor : rotational_v );
 end entity dc_motor;

 architecture behav of dc_motor is
     quantity w across t through rotor
	  to rotational_v_ref;
     quantity v across i through p to m;
 begin
   v == l*i'DOT + i*r + ke*w;
   t == i*kt - j*w'DOT - d*w;
 end architecture behav;